<html>
<head><meta charset="utf-8"><title>use rustc as backend? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html">use rustc as backend?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="162667825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162667825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162667825">(Apr 05 2019 at 22:39)</a>:</h4>
<p>is it possible for me to write a lexer and parser, and then lower it to MIR, and have rustc start compiling it as if it was a rust program? I know miri can accomplish this, but it's interpreted.</p>



<a name="162667918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162667918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162667918">(Apr 05 2019 at 22:40)</a>:</h4>
<p><span class="user-mention" data-user-id="116108">@Keith Yeung</span> there's nothing preventing that afaik; however, everything in rustc's internals is ofc highly unstable.</p>



<a name="162667975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162667975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162667975">(Apr 05 2019 at 22:40)</a>:</h4>
<p>ok, if so, is there a guide lying around that describes how one might be able to do so?</p>



<a name="162668008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162668008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162668008">(Apr 05 2019 at 22:41)</a>:</h4>
<p>or if there's a source file in particular that i should look at?</p>



<a name="162668156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162668156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162668156">(Apr 05 2019 at 22:42)</a>:</h4>
<p>maybe <a href="https://rust-lang.github.io/rustc-guide/" target="_blank" title="https://rust-lang.github.io/rustc-guide/">https://rust-lang.github.io/rustc-guide/</a> has something; the rustc driver infrastructure is beyond my expertise, maybe <span class="user-mention" data-user-id="116466">@Zoxc</span> can help</p>



<a name="162668297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162668297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162668297">(Apr 05 2019 at 22:44)</a>:</h4>
<p>Using rustc as a backend sounds like a terrible idea =P</p>



<a name="162668622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/use%20rustc%20as%20backend%3F/near/162668622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Keith Yeung <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/use.20rustc.20as.20backend.3F.html#162668622">(Apr 05 2019 at 22:48)</a>:</h4>
<p>huh, perhaps i should be asking whether there are good crates out there that provides good rust bindings to LLVM instead</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>